<% content_for :script do %>
  <script data-main="<%= ApplicationController.root_context -%>/js/issues/app" src="<%= ApplicationController.root_context -%>/js/require.js"></script>
<% end %>

<div class="navigator">
  <div class="navigator-header"></div>
  <div class="navigator-filters"></div>

  <div class="navigator-content">
    <div class="navigator-side">
      <div style="position:relative; overflow: visible; height: 100%;">
        <div class="navigator-actions"></div>
        <div class="navigator-results"></div>
        <a class="navigator-resizer"><i class="icon-resizer"></i></a>
      </div>
    </div>
    <div class="navigator-main">
      <div class="navigator-notes"><%= message('issue_filter.max_results_reached', :params => 10000) -%></div>
      <div class="navigator-details"></div>
    </div>
  </div>
</div>


<script>
  window.SS = {};

  _.extend(window.SS, {
    currentUser: '<%= current_user.login if current_user -%>',
    currentUserName: '<%= current_user.name if current_user -%>',
    severities: <%= RulesConfigurationController::RULE_PRIORITIES.to_json.html_safe -%>,
    statuses: <%= @options_for_statuses.to_json.html_safe -%>,
    resolutions: <%= @options_for_resolutions.to_json.html_safe -%>,
    favorites: <%= render :partial => 'issues/filter_favourites' -%>,
    languages: {<% controller.java_facade.getLanguages().to_a.sort {|a,b| a.getName() <=> b.getName()}.each do |language| -%>
      '<%= language.getKey().html_safe -%>': '<%= language.getName().html_safe -%>',
    <% end %>},

    phrases: {
      'actionPlan':    '<%= escape_javascript message('issue_filter.criteria.actionPlan') -%>',
      'actionPlanNotAvailable': '<%= escape_javascript message('issue_filter.criteria.actionPlanNotAvailable') -%>',
      'any':           '<%= escape_javascript message('any') -%>',
      'anytime':       '<%= escape_javascript message('anytime') -%>',
      'all':           '<%= escape_javascript message('all') -%>',
      'edit':          '<%= escape_javascript message('edit') -%>',
      'delete':        '<%= escape_javascript message('delete') -%>',
      'to':            '<%= escape_javascript message('to.downcase') -%>',
      'project':       '<%= escape_javascript message('issue_filter.criteria.project') -%>',
      'language':       '<%= escape_javascript message('language') -%>',
      'severity':      '<%= escape_javascript message('issue_filter.criteria.severity') -%>',
      'severities': {
        BLOCKER:       '<%= escape_javascript message('severity.BLOCKER') -%>',
        CRITICAL:      '<%= escape_javascript message('severity.CRITICAL') -%>',
        MAJOR:         '<%= escape_javascript message('severity.MAJOR') -%>',
        MINOR:         '<%= escape_javascript message('severity.MINOR') -%>',
        INFO:          '<%= escape_javascript message('severity.INFO') -%>'
      },
      'status':        '<%= escape_javascript message('issue_filter.criteria.status') -%>',
      'statuses': {
        OPEN:          '<%= escape_javascript message('issue.status.OPEN') -%>',
        CONFIRMED:     '<%= escape_javascript message('issue.status.CONFIRMED') -%>',
        REOPENED:      '<%= escape_javascript message('issue.status.REOPENED') -%>',
        RESOLVED:      '<%= escape_javascript message('issue.status.RESOLVED') -%>',
        CLOSED:        '<%= escape_javascript message('issue.status.CLOSED') -%>'
      },
      'actions': {
        comment:        '<%= escape_javascript message('issue.comment.formlink') -%>',
        assign:         '<%= escape_javascript message('issue.assign.formlink') -%>',
        assign_to_me:   '<%= escape_javascript message('issue.assign.to_me') -%>',
        assigned_to:    '<%= escape_javascript message('assigned_to') -%>',
        plan:           '<%= escape_javascript message('issue.do_plan') -%>',
        planned_for:    '<%= escape_javascript message('issue.planned_for') -%>',
        set_severity:   '<%= escape_javascript message('issue.set_severity') -%>',
        <%  Internal.issues.listPluginActions().each do |action| -%>
          '<%= escape_javascript action -%>': '<%= escape_javascript message("issue.action.#{action}.formlink") -%>',
        <% end -%>
      },
      'transitions': {
        confirm:        '<%= escape_javascript message('issue.transition.confirm') -%>',
        unconfirm:      '<%= escape_javascript message('issue.transition.unconfirm') -%>',
        resolve:        '<%= escape_javascript message('issue.transition.resolve') -%>',
        falsepositive:  '<%= escape_javascript message('issue.transition.falsepositive') -%>',
        reopen:         '<%= escape_javascript message('issue.transition.reopen') -%>',
        close:          '<%= escape_javascript message('issue.transition.close') -%>'
      },
      assignee:        '<%= escape_javascript message('issue_filter.criteria.assignee') -%>',
      resolution:      '<%= escape_javascript message('issue_filter.criteria.resolution') -%>',
      resolutions: {
        'RESOLVED':  '<%= escape_javascript message('issue.status.RESOLVED') -%>',
        'UNRESOLVED':  '<%= escape_javascript message('unresolved') -%>',
        'FALSE-POSITIVE': '<%= escape_javascript message('issue.resolution.FALSE-POSITIVE') -%>',
        'FIXED':       '<%= escape_javascript message('issue.resolution.FIXED') -%>',
        'REMOVED':     '<%= escape_javascript message('issue.resolution.REMOVED') -%>'
      },
      reporter:        '<%= escape_javascript message('issue_filter.criteria.reporter') -%>',
      rule:            '<%= escape_javascript message('issue_filter.criteria.rule') -%>',
      created:         '<%= escape_javascript message('issue_filter.criteria.created') -%>',
      createdAt:       '<%= escape_javascript message('issue_filter.criteria.created_at') -%>',

      moreCriteria:    '<%= escape_javascript message('issue_filter.more_criteria') -%>',
      unassigned:      '<%= escape_javascript message('unassigned') -%>',
      unplanned:       '<%= escape_javascript message('issue.unplanned') -%>',
      assignedToMe:    '<%= escape_javascript message('assigned_to_me') -%>',
      filtersList:     '<%= escape_javascript message('issue_filter.filter_list') -%>',
      commentConfirmDelete:  '<%= escape_javascript message('issue.comment.delete_confirm_message') -%>',
      requirementRemoved:    '<%= escape_javascript message('issue.technical_debt_deleted') -%>',

      select2: {
        noMatches: '<%= escape_javascript message('select2.noMatches') -%>',
        searching: '<%= escape_javascript message('select2.searching') -%>',
        tooShort: '<%= escape_javascript message('select2.tooShort', :params => [2]) -%>'
      },
      'Done': '<%= escape_javascript message("Done") -%>',
      'Prev': '<%= escape_javascript message("Prev") -%>',
      'Next': '<%= escape_javascript message("Next") -%>',
      'Today': '<%= escape_javascript message("Today") -%>',
      'January': '<%= escape_javascript message("January") -%>',
      'February': '<%= escape_javascript message("February") -%>',
      'March': '<%= escape_javascript message("March") -%>',
      'April': '<%= escape_javascript message("April") -%>',
      'May': '<%= escape_javascript message("May") -%>',
      'June': '<%= escape_javascript message("June") -%>',
      'July': '<%= escape_javascript message("July") -%>',
      'August': '<%= escape_javascript message("August") -%>',
      'September': '<%= escape_javascript message("September") -%>',
      'October': '<%= escape_javascript message("October") -%>',
      'November': '<%= escape_javascript message("November") -%>',
      'December': '<%= escape_javascript message("December") -%>',
      'Jan': '<%= escape_javascript message("Jan") -%>',
      'Feb': '<%= escape_javascript message("Feb") -%>',
      'Mar': '<%= escape_javascript message("Mar") -%>',
      'Apr': '<%= escape_javascript message("Apr") -%>',
      'Jun': '<%= escape_javascript message("Jun") -%>',
      'Jul': '<%= escape_javascript message("Jul") -%>',
      'Aug': '<%= escape_javascript message("Aug") -%>',
      'Sep': '<%= escape_javascript message("Sep") -%>',
      'Oct': '<%= escape_javascript message("Oct") -%>',
      'Nov': '<%= escape_javascript message("Nov") -%>',
      'Dec': '<%= escape_javascript message("Dec") -%>',
      'Sunday': '<%= escape_javascript message("Sunday") -%>',
      'Monday': '<%= escape_javascript message("Monday") -%>',
      'Tuesday': '<%= escape_javascript message("Tuesday") -%>',
      'Wednesday': '<%= escape_javascript message("Wednesday") -%>',
      'Thursday': '<%= escape_javascript message("Thursday") -%>',
      'Friday': '<%= escape_javascript message("Friday") -%>',
      'Saturday': '<%= escape_javascript message("Saturday") -%>',
      'Sun': '<%= escape_javascript message("Sun") -%>',
      'Mon': '<%= escape_javascript message("Mon") -%>',
      'Tue': '<%= escape_javascript message("Tue") -%>',
      'Wed': '<%= escape_javascript message("Wed") -%>',
      'Thu': '<%= escape_javascript message("Thu") -%>',
      'Fri': '<%= escape_javascript message("Fri") -%>',
      'Sat': '<%= escape_javascript message("Sat") -%>',
      'Su': '<%= escape_javascript message("Su") -%>',
      'Mo': '<%= escape_javascript message("Mo") -%>',
      'Tu': '<%= escape_javascript message("Tu") -%>',
      'We': '<%= escape_javascript message("We") -%>',
      'Th': '<%= escape_javascript message("Th") -%>',
      'Fr': '<%= escape_javascript message("Fr") -%>',
      'Sa': '<%= escape_javascript message("Sa") -%>'
    }
  });

  window.messages = {
    'all': '<%= escape_javascript message('all') -%>',
    'assigned_to': '<%= escape_javascript message('assigned_to') -%>',
    'bulk_change': '<%= escape_javascript message('bulk_change') -%>',
    'issue.planned_for': '<%= escape_javascript message('issue.planned_for') -%>',
    'issue.do_plan': '<%= escape_javascript message('issue.do_plan') -%>',
    'issue.planned_for': '<%= escape_javascript message('issue.planned_for') -%>',
    'more_actions': '<%= escape_javascript message('more_actions') -%>',
    'reporter': '<%= escape_javascript message('reporter') -%>',
    'author': '<%= escape_javascript message('author') -%>',
    'cancel': '<%= escape_javascript message('cancel') -%>',
    'save': '<%= escape_javascript message('save') -%>',
    'issue.technical_debt_short': '<%= escape_javascript message('issue.technical_debt_short') -%>',
    'issue.technical_debt_deleted': '<%= escape_javascript message('issue.technical_debt_deleted') -%>',
    'rule': '<%= escape_javascript message('rule') -%>',
    'changelog': '<%= escape_javascript message('changelog') -%>',
    'edit': '<%= escape_javascript message('edit') -%>',
    'delete': '<%= escape_javascript message('delete') -%>',
    'moreCriteria': '<%= escape_javascript message('issue_filter.more_criteria') -%>',
    'issue.plan.submit': '<%= escape_javascript message('issue.plan.submit') -%>',
    'issue.unplan.submit': '<%= escape_javascript message('issue.unplan.submit') -%>',
    'issue.assign.submit': '<%= escape_javascript message('issue.assign.submit') -%>',
    'issue.set_severity.submit': '<%= escape_javascript message('issue.set_severity.submit') -%>',
    'issue.comment.submit': '<%= escape_javascript message('issue.comment.submit') -%>',
    'issue.plan.error.plan_must_be_created_first_for_admin': '<%= escape_javascript message('issue.plan.error.plan_must_be_created_first_for_admin') -%>',
    'issue.plan.error.plan_must_be_created_first_for_other': '<%= escape_javascript message('issue.plan.error.plan_must_be_created_first_for_other') -%>',
    'markdown.helplink': '<%= escape_javascript message('markdown.helplink') -%>',
    'bold': '<%= escape_javascript message('bold') -%>',
    'code': '<%= escape_javascript message('code') -%>',
    'bulleted_point': '<%= escape_javascript message('bulleted_point') -%>',
    'severity.BLOCKER': '<%= escape_javascript message('severity.BLOCKER') -%>',
    'severity.CRITICAL': '<%= escape_javascript message('severity.CRITICAL') -%>',
    'severity.MAJOR': '<%= escape_javascript message('severity.MAJOR') -%>',
    'severity.MINOR': '<%= escape_javascript message('severity.MINOR') -%>',
    'severity.INFO': '<%= escape_javascript message('severity.INFO') -%>',

    'component_viewer.measure_section.size': '<%= escape_javascript message('component_viewer.measure_section.size') -%>',
    'component_viewer.measure_section.complexity': '<%= escape_javascript message('component_viewer.measure_section.complexity') -%>',
    'component_viewer.measure_section.structure': '<%= escape_javascript message('component_viewer.measure_section.structure') -%>',
    'component_viewer.measure_section.documentation': '<%= escape_javascript message('component_viewer.measure_section.documentation') -%>',
    'component_viewer.measure_section.severities': '<%= escape_javascript message('component_viewer.measure_section.severities') -%>',
    'component_viewer.measure_section.rules': '<%= escape_javascript message('component_viewer.measure_section.rules') -%>',
    'component_viewer.measure_section.issues': '<%= escape_javascript message('component_viewer.measure_section.issues') -%>',
    'component_viewer.measure_section.sqale': '<%= escape_javascript message('component_viewer.measure_section.sqale') -%>',
    'component_viewer.measure_section.unit_tests': '<%= escape_javascript message('component_viewer.measure_section.unit_tests') -%>',
    'component_viewer.measure_section.integration_tests': '<%= escape_javascript message('component_viewer.measure_section.integration_tests') -%>',

    'component_viewer.issues.current_issue': '<%= escape_javascript message('component_viewer.issues.current_issue') -%>',
    'component_viewer.issues.unresolved_issues': '<%= escape_javascript message('component_viewer.issues.unresolved_issues') -%>',
    'component_viewer.issues.false_positive_issues': '<%= escape_javascript message('component_viewer.issues.false_positive_issues') -%>',

    'component_viewer.header.debt': '<%= escape_javascript message('component_viewer.header.debt') -%>',
    'component_viewer.header.toggle_issues': '<%= escape_javascript message('component_viewer.header.toggle_issues') -%>',
    'component_viewer.header.toggle_coverage': '<%= escape_javascript message('component_viewer.header.toggle_coverage') -%>',
    'component_viewer.header.toggle_duplications': '<%= escape_javascript message('component_viewer.header.toggle_duplications') -%>',

    'metric.lines.name': '<%= escape_javascript message('metric.lines.name') -%>',
    'metric.ncloc.name': '<%= escape_javascript message('metric.ncloc.name') -%>',
    'metric.complexity.name': '<%= escape_javascript message('metric.complexity.name') -%>',
    'metric.function_complexity.name': '<%= escape_javascript message('metric.function_complexity.name') -%>',
    'metric.classes.name': '<%= escape_javascript message('metric.classes.name') -%>',
    'metric.functions.name': '<%= escape_javascript message('metric.functions.name') -%>',
    'metric.accessors.name': '<%= escape_javascript message('metric.accessors.name') -%>',
    'metric.statements.name': '<%= escape_javascript message('metric.statements.name') -%>',
    'metric.comment_lines.name': '<%= escape_javascript message('metric.comment_lines.name') -%>',
    'metric.comment_lines_density.name': '<%= escape_javascript message('metric.comment_lines_density.name') -%>',
    'metric.public_api.name': '<%= escape_javascript message('metric.public_api.name') -%>',
    'metric.public_undocumented_api.name': '<%= escape_javascript message('metric.public_undocumented_api.name') -%>',
    'metric.public_documented_api_density.name': '<%= escape_javascript message('metric.public_documented_api_density.name') -%>',

    'metric.coverage.name': '<%= escape_javascript message('metric.coverage.name') -%>',
    'metric.line_coverage.name': '<%= escape_javascript message('metric.line_coverage.name') -%>',
    'metric.lines_to_cover.name': '<%= escape_javascript message('metric.lines_to_cover.name') -%>',
    'metric.covered_lines.name': '<%= escape_javascript message('metric.covered_lines.name') -%>',
    'metric.uncovered_lines.name': '<%= escape_javascript message('metric.uncovered_lines.name') -%>',
    'metric.branch_coverage.name': '<%= escape_javascript message('metric.branch_coverage.name') -%>',
    'metric.conditions_to_cover.name': '<%= escape_javascript message('metric.conditions_to_cover.name') -%>',
    'metric.covered_conditions.name': '<%= escape_javascript message('metric.covered_conditions.name') -%>',
    'metric.uncovered_conditions.name': '<%= escape_javascript message('metric.uncovered_conditions.name') -%>',

    'metric.duplicated_blocks.name': '<%= escape_javascript message('metric.duplicated_blocks.name') -%>',
    'metric.duplicated_files.name': '<%= escape_javascript message('metric.duplicated_files.name') -%>',
    'metric.duplicated_lines.name': '<%= escape_javascript message('metric.duplicated_lines.name') -%>',
    'metric.duplicated_lines_density.name': '<%= escape_javascript message('metric.duplicated_lines_density.name') -%>',

    'metric.violations.name': '<%= escape_javascript message('metric.violations.name') -%>',
    'metric.sqale_index.name': '<%= escape_javascript message('metric.sqale_index.name') -%>',
    'metric.blocker_violations.name': '<%= escape_javascript message('metric.blocker_violations.name') -%>',
    'metric.critical_violations.name': '<%= escape_javascript message('metric.critical_violations.name') -%>',
    'metric.major_violations.name': '<%= escape_javascript message('metric.major_violations.name') -%>',
    'metric.minor_violations.name': '<%= escape_javascript message('metric.minor_violations.name') -%>',
    'metric.info_violations.name': '<%= escape_javascript message('metric.info_violations.name') -%>'
  };
</script>
